<!--

/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/**
* brief description of file
*
* @author      Tom Murtagh
* @author      Kim Jackson
* @author      Ian Johnson   <ian.johnson@sydney.edu.au>
* @author      Stephen White   <stephen.white@sydney.edu.au>
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @copyright   (C) 2005-2013 University of Sydney
* @link        http://Sydney.edu.au/Heurist
* @version     3.1.0
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package     Heurist academic knowledge management system
* @subpackage  !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/

-->
<!--

/**
 * listRectypeDescriptions.html, human readable list of record types with their fields and parameters
 * @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
 * @link: http://HeuristScholar.org
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @package Heurist academic knowledge management system
 * @todo
 **/

-->
<html>
 <head>
  <title>Heurist record structures listing</title>

  <link rel="stylesheet" type="text/css" href="../../common/css/global.css">
  <link rel="icon" href="../../favicon.ico" type="image/x-icon">
  <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon">

  <style type="text/css">
  	body {
  		background-color: #FFFFFF;
  	    overflow:auto;
	}
	a img {
		border: 0;
	}
	thead {
		text-align: left;
	}
	table table td, table table th {
		padding-right: 10px;
	}
	tr {
		vertical-align: top;
	}
	.rft_icon {
		margin-right: 5px;
		vertical-align: middle;
	}
	.rty_Name {
		font-weight: bold;
	}
  </style>

 </head>

 <body>

  <div style="padding: 10px;">

<div class="headline">Record types for database: [dbname!] </div>
<p/>

Requirements: req. = Required, rec. = Recommended, xcl. = Forbidden, otherwise Optional
<br>Status: Reserved, Approved, Pending, otherwise Open
<p>

<table border="0">

 [foreach rectype rtf : rty_ID order by (rty_RecTypeGroupID), rty_OrderInGroup, rty_Name]
 <tr class="rty_Name">
  <td style="text-align: right;">[rty_ID]</td>
  <td><img src="[iconURL!][rty_ID].png" id="rt[rty_ID]" class="rft_icon"><span class="rty_Name">[rty_Name]</span></td>
 </tr>
 <tr>
  <td></td>
  <td>
   <table border="0">
    <tr><td>Notes:</td><td>[rty_Description]</td></tr>
    <tr><td>Title Mask:</td><td>[rty_TitleMask]</td></tr>
    <tr><td>Status:</td><td>[rty_Status]</td></tr>
    <tr><td>Origin code/name:</td><td>[rty_OriginatingDBID]-[rty_IDInOriginatingDB] [rty_NameInOriginatingDB]</td></tr>
    <tr><td>Locally modified:</td><td>[rty_LocallyModified]</td></tr>
    <tr><td>Non owner visibility:</td><td>[rty_NonOwnerVisibility]</td></tr>
    <tr><td>Show in lists:</td><td>[rty_ShowInLists]</td></tr>
    <tr><td>Flag as fieldset:</td><td>[rty_FlagAsFieldset]</td></tr>
   </table>
   </td>
 </tr>
 <tr>
  <td></td>
  <td>
   <table width = 1500 border="0">
    <thead>
	 <tr><th>Code</th><th>Prompt</th><th>Type</th><th>Req.</th><th>Min</th><th>Max</th><th>Match</th><th>Seen-by</th><th>Origin code</th><th>LocMod</th><th>Status</th>
	 <th>Order</th><th>Default</th><th>Width</th><th>Prompt</th></tr>

	</thead>
	<tbody>
	 [foreach BIB_DETAIL_REQ bdr : 1 order by rst_DisplayOrder, rst_ID]
	 <tr>
	  <td width="30">[select BIB_DETAIL_TYPE bdt][dty_ID][end-select]</td>
	  <td width="150">[rst_DisplayName]</td>
	  <td width="100" style="text-align: left;">[select BIB_DETAIL_TYPE bdt][dty_Type][end-select]</td>

	  <td width="30" style="text-align: left;"><script type="text/javascript">
	     document.write('[rst_RequirementType]' == 'optional'?'':'[rst_RequirementType]' == 'required'?'req.':'[rst_RequirementType]' == 'recommended'?'rec.':'xcl.');</script></td>

	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  	document.write('[rst_MinValues]'==0?'':'[rst_MinValues]');</script></td>
	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  	document.write('[rst_MaxValues]'==0?'unlim':'[rst_MaxValues]');</script></td>
	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  	document.write('[rst_RecordMatchOrder]'==0?'':'[rst_RecordMatchOrder]');</script></td>

	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  document.write('[rst_NonOwnerVisibility]' == 'hidden'?'Owner':'[rst_NonOwnerVisibility]' == 'viewable'?'Login':'[rst_NonOwnerVisibility]' == 'pending'?'Pending':
	  'Public');</script></td>

	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  	document.write([select BIB_DETAIL_TYPE bdt][dty_OriginatingDBID][end-select]>0?'[select BIB_DETAIL_TYPE bdt][dty_OriginatingDBID][end-select]-':'');document.write([select BIB_DETAIL_TYPE bdt][dty_OriginatingDBID][end-select]>0?'[select BIB_DETAIL_TYPE bdt][dty_IDInOriginatingDB][end-select]':'');</script></td>

	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  	document.write('[rst_LocallyModified]'==1?'Yes':'');</script></td>

	  <td width="30" style="text-align: left;"><script type="text/javascript">
	  	document.write('[rst_Status]' == 'reserved'?'Rsrvd.':'[rst_Status]' == 'approved'?'appr.':'[rst_Status]' == 'pending'?'pend.':'');</script></td>

	  <td width="30">[rst_DisplayOrder]</td>
	  <td width="30">[rst_DefaultValue]</td>
	  <td width="60">[rst_DisplayWidth]</td>
	  <td>[rst_DisplayHelpText]</td>
	 </tr>
	 <tr>
	 <td width="30"></td>
	 <td width="150"></td>

	 <!-- This is quick-and-dirty, lists numeric values for record pointers and terms,
	      first the detail type list then the override list if present
	      Really needs proper formatting and explanation in the output -->

	 <td colspan="13" rowspan="1" nowrap="nowrap" width="100" style="text-align:left; overflow:hidden">
		 [select BIB_DETAIL_TYPE bdt]
	 		<script type="text/javascript">
	 			document.write('[dty_PtrTargetRectypeIDs]'==''?'':'Targets: [dty_PtrTargetRectypeIDs]');
	 		</script>
		 [end-select]
		 <script type="text/javascript">
	 			document.write('[rst_PtrFilteredIDs]'==''?'':' Filtered: [rst_PtrFilteredIDs]');
	 		</script>

     	 [select BIB_DETAIL_TYPE bdt]
     	 	<script type="text/javascript">
	 			document.write('[dty_JsonTermIDTree]'==''?'':'Terms: [dty_JsonTermIDTree]');
	 		</script>
     	 [end-select]
	 	 <script type="text/javascript">
	 	 		document.write('[rst_FilteredJsonTermIDTree]'==''?'':' Filtered: [rst_FilteredJsonTermIDTree]');
	 	 	</script>
	 </td>
     </tr>
     <tr><td>&nbsp;</td></tr>
	 [end-foreach]
	 [not-found][end-not-found]
	</tbody>
   </table>
   <hr/>
   </td>
 </tr>
 [end-foreach]
 [not-found][end-not-found]
</table>



  </div>

 </body>
</html>
